package com.console.operations.fundmgr;

import org.testng.Assert;

import com.common.test.OperationBase;
import com.common.test.UITestBase;
import com.common.util.DBUtil;
import com.console.pages.fundmgr.WithdrawPage;


public class WithdrawFirst extends OperationBase {

	public WithdrawFirst(UITestBase tb){
		super(tb);
	}
	
	public void Trial() throws Exception{
		//进入提现初审页面
		switchToDefaultContent();
		WithdrawPage wp = new WithdrawPage(tb);
		waitForElementExist(wp.cashpage);
		wp.cashpage.click();
		waitForElementExist(wp.WithdrawFirst);
		wp.WithdrawFirst.click();
		waitForElementExist(wp.WithdrawFirstNo);
		//获取提现编号
		String wfn = wp.WithdrawFirstNo.getText();
		System.out.println("提现编号是："+wfn);
		//点击初审通过
		wp.FirstSummry.click();
		waitForElementExist(wp.FirstPass);
		wp.FirstPass.click();
		waitForElementExist(wp.ConfirmPass);
		wp.ConfirmPass.click();
		waitForElementExist(wp.ConfirmInfo);
		//验证初审通过
		String ci = wp.ConfirmInfo.getText();
		System.out.println("获得返回信息是："+ci);
		Assert.assertEquals(ci,"初审通过");
		//验证提现状态是否变化
		String wfs=DBUtil.queryOneCell("select dc_status from fiz_withdraw where vc_batch = ?", new Object[]{wfn});
		System.out.println("数据库查询状态为："+wfs);
		Assert.assertEquals(wfs,"03");
	}
}
